<?php
/**
 * @user:andy
 * @date:2021/7/24
 * @company:http://www.sjdphp.com
 * @desc:
 */

namespace app\admin\controller;


use app\common\controller\BackBaseController;
use app\common\server\Json;
use app\common\server\Tree;

class System extends BackBaseController
{
    protected $model_id = 'system_id';
    protected $model_name = 'system_iden';
    protected $model_status = 'system_status';
    public function lists(){
        ## 默认查询数据的状态
        $term[] = [$this->model_status,'<>',config("project.mysql_code.table_delete")];

        ## 获取实例
        $class = self::getBusExample($this->request->controller());
        ## 查询单条数据
        $lists = $class::getArrayLists($term,'',0,0,'');

        return view('',[
            'lists' => $lists,
        ]);
    }



    public function edit(){
        if($this->request->isPost()){
            $param = $this->request->param();

            $class = self::getBusExample($this->request->controller());
            $res = $class::updateData($param);

            return $res;
        }else{
            return Json::error("请求方式错误");
        }
    }

}